#pragma once
#include <iostream>
#include <odb/tracer.hxx>
#include <odb/forward.hxx>
#include <odb/statement.hxx>
#include <odb/database.hxx>
#include <odb/mysql/database.hxx>
#include <gflags/gflags.h>
#include <memory>
#include <mysql.h>
namespace zzy_mims
{
    class ODBFactory
    {
    public:
        static std::shared_ptr<odb::core::database> create
        (const std::string& user,
        const std::string& password,
        const std::string& db,
        const std::string& host,
        const std::string& charset,
        const int port,const int conn_max_pool)
        {
            auto cpf = std::make_unique<odb::mysql::connection_pool_factory>(conn_max_pool,0);
            auto ret = std::make_shared<odb::mysql::database>(user,password,db,host,port,"",charset,0, std::move(cpf));
            return ret;
        }
    };
}


